java.lang.ObjectTrain
public class Train
| Constructor Summary | |
|---|---|
Train()
Constructs an empty train; i.e., one that has no cars. |
|
| Method Summary | |
|---|---|
void |
addCar(Car car)
Adds the specified car to this train. |
boolean |
cancelTicket(int carId,
int seatNo)
Cancels the ticket for the specified seat in the specified car. |
java.util.ArrayList<Car> |
cars()
Returns this trains's list of cars. |
boolean |
issueTicket(boolean businessClassSeat)
Attempts to issue a ticket for a business class seat or an economy class seat, as specified by the method's argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Train()
| Method Detail |
|---|
public void addCar(Car car)
public boolean cancelTicket(int carId,
int seatNo)
public java.util.ArrayList<Car> cars()
public boolean issueTicket(boolean businessClassSeat)